home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / MDELAY.DMO < prev    next >
Text File  |  1996-07-04  |  3KB  |  60 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   MDELAY  .DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20.  
  21. $INCLUDE "DAS-NB01.INC"
  22. COLOR 7, 0
  23. CLS
  24.  
  25. ? "┌─────────────────────────────────────────────────────────────────────────────
  26. ? "│  MDelay    ( Msecs% )  Just like DELAY but uses 1/1000ths of a second
  27. ? "│  SetDelay  ( Msecs% )  Initiate and start an MDelay counter
  28. ? "│  EndDelay  ()          Wait for MDelay counter to hit 0
  29. ? "│ fEndDelay% ()          Same as above but returns Msecs% at time of calling
  30. ? "├─────────────────────────────────────────────────────────────────────────────
  31. ? "│ This family of subs brings almost infinite time control to your programs!
  32. ? "│ They work about 20 times more accurately than DELAY and you are given the
  33. ? "│ capability of setting the timer, doing some work, THEN pausing until bell
  34. ? "│ bell rings!
  35. ? "│
  36. ? "│ fEndDelay% is a programmer's tool as it works just like EndDelay but returns
  37. ? "│            the time remaining on the clock when it was called.
  38. ? "└─────────────────────────────────────────────────────────────────────────────
  39. ?
  40.  
  41. T! = TIMER
  42.   MDelay 50
  43. T! = ( TIMER - T! )
  44. PRINT USING "ELAPSED TIME FOR 50 msec: #.#### seconds"; T!
  45. PRINT
  46.  
  47. T! = TIMER
  48.   SetDelay 500
  49.     PRINT "PAUSE THE PROGRAM FOR .5 sec. INCLUDING THE TIME SPENT PRINTING THIS!"
  50.   EndDelay
  51. T! = ( TIMER - T! )
  52. PRINT USING "ELAPSED TIME: #.#### seconds"; T!
  53. PRINT
  54.  
  55. SetDelay 500
  56.   PRINT "THE TIME HAS ";
  57.   DELAY 1
  58. IF fEndDelay% THEN PRINT "NOT ";
  59. PRINT "RUN OUT!"
  60.